<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>会议室预定系统 - 登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        
        .login-container {
            background: white;
            border-radius: 16px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            max-width: 900px;
            width: 100%;
            display: grid;
            grid-template-columns: 1fr 1fr;
        }
        
        .login-left {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 60px 40px;
            color: white;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        
        .login-left h1 {
            font-size: 32px;
            margin-bottom: 20px;
        }
        
        .login-left p {
            font-size: 16px;
            opacity: 0.9;
            line-height: 1.6;
        }
        
        .login-right {
            padding: 60px 40px;
        }
        
        .login-title {
            text-align: center;
            margin-bottom: 40px;
        }
        
        .login-title h2 {
            color: #262626;
            font-size: 28px;
            margin-bottom: 10px;
        }
        
        .login-title p {
            color: #8c8c8c;
            font-size: 14px;
        }
        
        .login-options {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .login-option {
            border: 2px solid #e8e8e8;
            border-radius: 12px;
            padding: 30px;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
        }
        
        .login-option:hover {
            border-color: #667eea;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
            transform: translateY(-2px);
        }
        
        .login-option.active {
            border-color: #667eea;
            background: #f0f5ff;
        }
        
        .login-option .icon {
            font-size: 48px;
            margin-bottom: 15px;
        }
        
        .login-option h3 {
            color: #262626;
            font-size: 20px;
            margin-bottom: 8px;
        }
        
        .login-option p {
            color: #8c8c8c;
            font-size: 14px;
        }
        
        /* 管理员密码弹窗 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        
        .modal.active {
            display: flex;
        }
        
        .modal-content {
            background: white;
            border-radius: 12px;
            padding: 40px;
            max-width: 400px;
            width: 90%;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        }
        
        .modal-header {
            text-align: center;
            margin-bottom: 30px;
        }
        
        .modal-header h3 {
            color: #262626;
            font-size: 24px;
            margin-bottom: 8px;
        }
        
        .modal-header p {
            color: #8c8c8c;
            font-size: 14px;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-group label {
            display: block;
            color: #262626;
            font-weight: 500;
            margin-bottom: 8px;
        }
        
        .form-group input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid #d9d9d9;
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s;
        }
        
        .form-group input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        
        .error-message {
            color: #ff4d4f;
            font-size: 14px;
            margin-top: 8px;
            display: none;
        }
        
        .error-message.show {
            display: block;
        }
        
        .modal-actions {
            display: flex;
            gap: 12px;
            margin-top: 30px;
        }
        
        .btn {
            flex: 1;
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        
        .btn-primary:hover {
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
            transform: translateY(-2px);
        }
        
        .btn-default {
            background: white;
            color: #262626;
            border: 1px solid #d9d9d9;
        }
        
        .btn-default:hover {
            border-color: #667eea;
            color: #667eea;
        }
        
        @media (max-width: 768px) {
            .login-container {
                grid-template-columns: 1fr;
            }
            
            .login-left {
                display: none;
            }
        }
    </style>
</head>
<body>
    <div class="login-container">
        <!-- 左侧装饰区域 -->
        <div class="login-left">
            <h1>🏢 会议室预定系统</h1>
            <p>高效管理您的会议室资源</p>
            <p style="margin-top: 20px;">
                • 快速预定会议室<br>
                • 实时查看可用性<br>
                • 智能时间冲突检测<br>
                • 便捷的管理功能
            </p>
        </div>
        
        <!-- 右侧登录选项 -->
        <div class="login-right">
            <div class="login-title">
                <h2>欢迎使用</h2>
                <p>请选择您的使用方式</p>
            </div>
            
            <div class="login-options">
                <!-- 用户入口 -->
                <div class="login-option" onclick="goToUserBooking()">
                    <div class="icon">📅</div>
                    <h3>我要预定会议室</h3>
                    <p>快速预定和查看会议室</p>
                </div>
                
                <!-- 管理员入口 -->
                <div class="login-option" onclick="showAdminLogin()">
                    <div class="icon">🔐</div>
                    <h3>我是管理员</h3>
                    <p>管理会议室和系统设置</p>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 管理员密码验证弹窗 -->
    <div class="modal" id="adminModal">
        <div class="modal-content">
            <div class="modal-header">
                <h3>管理员验证</h3>
                <p>请输入管理员密码</p>
            </div>
            
            <form id="adminForm" onsubmit="verifyAdminPassword(event)">
                <div class="form-group">
                    <label for="adminPassword">管理员密码</label>
                    <input 
                        type="password" 
                        id="adminPassword" 
                        placeholder="请输入密码"
                        autocomplete="off"
                    >
                    <div class="error-message" id="errorMsg">
                        密码错误，请重试
                    </div>
                </div>
                
                <div class="modal-actions">
                    <button type="button" class="btn btn-default" onclick="closeAdminModal()">
                        取消
                    </button>
                    <button type="submit" class="btn btn-primary">
                        确认
                    </button>
                </div>
            </form>
        </div>
    </div>
    
    <script>
        // 默认管理员密码（实际应用中应从数据库读取）
        const DEFAULT_ADMIN_PASSWORD = '123456789';
        
        // 跳转到用户预定界面
        function goToUserBooking() {
            // 实际应用中跳转到 user_booking.html
            alert('跳转到用户预定界面\n\n在实际应用中，这里会跳转到用户预定页面');
            // window.location.href = 'user_booking.html';
        }
        
        // 显示管理员登录弹窗
        function showAdminLogin() {
            document.getElementById('adminModal').classList.add('active');
            document.getElementById('adminPassword').focus();
        }
        
        // 关闭管理员登录弹窗
        function closeAdminModal() {
            document.getElementById('adminModal').classList.remove('active');
            document.getElementById('adminPassword').value = '';
            document.getElementById('errorMsg').classList.remove('show');
        }
        
        // 验证管理员密码
        function verifyAdminPassword(event) {
            event.preventDefault();
            
            const password = document.getElementById('adminPassword').value;
            const errorMsg = document.getElementById('errorMsg');
            
            // 实际应用中应该调用后端API验证密码
            // 这里使用默认密码进行验证
            if (password === DEFAULT_ADMIN_PASSWORD) {
                // 验证成功，跳转到管理员界面
                alert('验证成功！\n\n在实际应用中，这里会跳转到管理员界面');
                // window.location.href = 'admin_interface.html';
                closeAdminModal();
            } else {
                // 验证失败，显示错误信息
                errorMsg.classList.add('show');
                document.getElementById('adminPassword').value = '';
                document.getElementById('adminPassword').focus();
                
                // 3秒后隐藏错误信息
                setTimeout(() => {
                    errorMsg.classList.remove('show');
                }, 3000);
            }
        }
        
        // 点击弹窗外部关闭弹窗
        document.getElementById('adminModal').addEventListener('click', function(e) {
            if (e.target === this) {
                closeAdminModal();
            }
        });
        
        // ESC键关闭弹窗
        document.addEventListener('keydown', function(e) {
            if (e.key === 'Escape') {
                closeAdminModal();
            }
        });
    </script>
</body>
</html>
